/*
 * Camera.cpp
 *
 *  Created on: Jul 11, 2009
 *      Author: scott
 */

#include "Camera.h"
#include <gl/gl.h>
#include <gl/glu.h>

Camera::Camera(SceneGraphNode * parent, bool ownsChildren) :
	SceneGraphNode(parent, ownsChildren)
{

	lookAt = irr::core::vector3df(0, 0, 0);
	up = irr::core::vector3df(0, 1.0f, 0);

}

Camera::~Camera() {

}

void Camera::applyProj()
{
	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix
	glLoadIdentity();									// Reset The Projection Matrix

	// set the perspective parameters
	gluPerspective(fov, aspectRatio, nearClip, farClip);

	glMatrixMode(GL_MODELVIEW);
}

void Camera::applyView()
{
	irr::core::vector3df position = getTranslation();
	gluLookAt(position.X, position.Y, position.Z,
			lookAt.X, lookAt.Y, lookAt.Z,
			up.X, up.Y, up.Z);
}

void Camera::update()
{

}





